﻿@using IceTea.Domain;
@using IceTea.Infrastructure;

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="navbar-header">
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
        <span class="sr-only">Toggle Navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
    </button>
     <a href="/Home/Index"><img class="logo" src="~/Content/images/llogo.png" /></a>
</div>
<div class="navbar-collapse collapse navbar-ex1-collapse">
     <ul class="nav navbar-nav">
         <li class="dropdown">
             <a class="dropdown-toggle" href="#" data-toggle="dropdown">
                 @{
                 IceTeaPrincipal profile = User as IceTeaPrincipal;
                 var projTitle = "[You need choose product]";
                 if (profile != null && profile.RoleProfile.CurrentProductId >= 0)
                 {projTitle = profile.RoleProfile.CurrentProductName;}
                 }
                 <span>@projTitle</span><b class="caret"></b>
             </a>
             <ul class="dropdown-menu">
                 <li><a href="~/Product/Choose"><span class="glyphicon glyphicon-list"></span> Choose Product</a>
                 </li>
                 @if (Html.IsVisible(SecurityRole.SuperAdmin)){  
                 <li class="divider"></li>
                 <li><a href="~/Product/CreateNew"><span class="glyphicon glyphicon-plus"></span> Create New Product</a>
                 </li>}
             </ul>
         </li>
         <li class="divider-vertical"></li>
         <li>@Html.ActionLink("Product", "Index", "Product")</li>
         <li class="divider-vertical"></li>
         <li><a href="#">Sprint</a></li>
         <li class="divider-vertical"></li>
         <li><a href="#">Bugs</a></li>
         <li class="divider-vertical"></li>
         <li><a href="#">Tasks</a></li>
     </ul> 
    <ul class="nav navbar-nav navbar-right">
        @Html.Action("UserInfo", "Account")
    </ul>
</div>     

</nav>